home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesC-D.lzh / Chrome.lha / ChromeHD / Install < prev    next >
Text File  |  2001-07-08  |  3KB  |  180 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "")            ;sub directory containing data files
  4. (set #readme-file "ReadMe")        ;name of readme file
  5. (set #highs-file "Chrome.highs")    ;name of high scores file
  6. (set #cleanup "")            ;files to delete after install
  7.  
  8. ;****************************
  9. ;----------------------------
  10. ; checks if given program is installed, if not abort install
  11. ; #program - to check
  12.  
  13. (procedure P_ChkRun
  14.   (if
  15.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  16.     ("")
  17.     (abort
  18.       (cat
  19.     "You must install \"" #program "\" first!\n"
  20.     "It must be accessible via the path.\n"
  21.     "You can find it in the WHDLoad package."
  22.       )
  23.     )
  24.   )
  25. )
  26.  
  27. ;----------------------------
  28. ; Wait for inserting disk
  29. ; IN:  #AD_disk - name of disk
  30. ; OUT: -
  31.  
  32. (procedure P_disk
  33.   (askdisk
  34.     (dest #AD_disk)
  35.     (prompt ("\nInsert Disk \"%s\" in any drive!" #AD_disk))
  36.     (help @askdisk-help)
  37.   )
  38. )
  39.  
  40. ;****************************
  41.  
  42. (if
  43.   (exists #readme-file)
  44.   (if
  45.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  46.     ("")
  47.     (run ("SYS:Utilities/More %s" #readme-file))
  48.   )
  49. )
  50.  
  51. (set #program "WHDLoad")
  52. (P_ChkRun)
  53.  
  54. (set @default-dest
  55.   (askdir
  56.     (prompt ("Where should \"%s\" be installed?\nA drawer \"%s\" will be automatically created." @app-name @app-name))
  57.     (help @askdir-help)
  58.     (default @default-dest)
  59.     (disk)
  60.   )
  61. )
  62. (set #dest (tackon @default-dest @app-name))
  63. (if
  64.   (exists #dest)
  65.   (
  66.     (set #choice
  67.       (askbool
  68.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted?" #dest))
  69.         (default 1)
  70.         (choices "Delete" "Skip")
  71.         (help @askbool-help)
  72.       )
  73.     )
  74.     (if
  75.       (= #choice 1)
  76.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  77.     )
  78.   )
  79. )
  80. (makedir #dest
  81.   (help @makedir-help)
  82.   (infos)
  83. )
  84.  
  85. ;----------------------------
  86.  
  87. (copyfiles
  88.   (help @copyfiles-help)
  89.   (source ("%s.Slave" @app-name))
  90.   (dest #dest)
  91. )
  92. (if
  93.   (exists ("%s.newicon" @app-name))
  94.   (set #icon
  95.     (askchoice
  96.       (prompt "\nWhich icon would you like to install?\n")
  97.       (default 0)
  98.       (choices "Normal" "NewIcon" "GlowIcon")
  99.       (help @askchoice-help)
  100.     )
  101.   )
  102.   (set #icon 0)
  103. )
  104. (select #icon
  105.   (set #icon ("%s.inf" @app-name))
  106.   (set #icon ("%s.newicon" @app-name))
  107.   (set #icon ("%s.glowicon" @app-name))
  108. )
  109. (copyfiles
  110.   (help @copyfiles-help)
  111.   (source #icon)
  112.   (newname ("%s.info" @app-name))
  113.   (dest #dest)
  114. )
  115. (tooltype
  116.   (dest (tackon #dest @app-name))
  117.   (settooltype "Slave" ("%s.Slave" @app-name))
  118.   (setdefaulttool "WHDLoad")
  119.   (setstack 10240)
  120.   (noposition)
  121. )
  122. (if
  123.   (exists #readme-file)
  124.   (copyfiles
  125.     (help @copyfiles-help)
  126.     (source #readme-file)
  127.     (dest #dest)
  128.   )
  129. )
  130. (if
  131.   (exists ("%s.info" #readme-file))
  132.   (
  133.     (copyfiles
  134.       (help @copyfiles-help)
  135.       (source ("%s.info" #readme-file))
  136.       (dest #dest)
  137.     )
  138.     (tooltype
  139.       (dest (tackon #dest #readme-file))
  140.       (noposition)
  141.     )
  142.   )
  143. )
  144.  
  145. (if
  146.   (= #sub-dir "")
  147.   ("")
  148.   (
  149.     (set #dest (tackon #dest #sub-dir))
  150.     (makedir #dest
  151.       (help @makedir-help)
  152.     )
  153.   )
  154. )
  155. (if
  156.   (exists #highs-file)
  157.   (copyfiles
  158.     (help @copyfiles-help)
  159.     (source #highs-file)
  160.     (dest #dest)
  161.   )
  162. )
  163.  
  164. ;----------------------------
  165.  
  166. (set #AD_disk "CU Coverdisk #35")
  167. (P_disk)
  168. (copyfiles
  169.   (help @copyfiles-help)
  170.   (source ("%s:" #AD_disk))
  171.   (dest #dest)
  172.   (pattern "(Chrome)")
  173. )
  174.  
  175. ;----------------------------
  176.  
  177. (run ("Delete %s ALL QUIET FORCE" #cleanup))
  178.  
  179. (exit)
  180.